package com.itcam.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;

/**
 * Author:Cammy.Wu
 * Date:2024-05-06
 * Description:控制层的配置类(controller、springmvc)
 *
 * 1.controller
 * 2.全局异常处理
 * 3.handlerMapping handlerAdapter
 * 4.静态资源处理
 * 5.jsp 视图解析器的前后缀
 * 6.json转换器
 * 7.拦截器
 * 8....
 */

@EnableWebMvc
@Configuration
@ComponentScan("com.itcam.controller")
public class WebMvcJavaConfig implements WebMvcConfigurer {

    @Override
    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
        configurer.enable();
    }

    @Override
    public void configureViewResolvers(ViewResolverRegistry registry) {
        registry.jsp("/WEB-INF-views/","jsp");
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new xx()).addPathPatterns().excludePathPatterns();
    }
}
